<?php

namespace app\admin\validate;

use think\Validate;

class Behavior extends Validate
{

    /**
     * 验证规则
     */
    protected $rule = [
        'name' => 'require',
        'type' => 'require',
        'score' => 'require|positiveFloat',
    ];

    /**
     * 提示消息
     */
    protected $message = [
    ];

    /**
     * 字段描述
     */
    protected $field = [
    ];

    /**
     * 验证场景
     */
    protected $scene = [
    ];

    protected function positiveFloat($value)
    {
        if (is_numeric($value) && $value > 0) {
            return true;
        } else {
            return '分值 必须为正数';
        }
    }


}
